﻿using System;
using System.Collections.Generic;
using System.Web.UI;
using FrienDev.BusinessRules;
using FrienDev.Data;

public partial class Controls_Users_Track : UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        object tracks;
        if (ApiHelper.Instance.IsFriendsPage())
        {
            lblTitle.Text = "他的动态";
            lnkAllTrack.Visible = false;
            tracks = TrackRules.Instance.GetTrackByUserId(ApiHelper.Instance.GetRequestUserId(), 30);
        }
        else
        {
            lblTitle.Text = "好友动态";
            lnkAllTrack.NavigateUrl = "/home/track.aspx";
            tracks = TrackRules.Instance.GetFriendsTrackByUserId(UserRules.Instance.GetCurrentUserId(), 30);
        }

        rptTrackList.DataSource = tracks;
        rptTrackList.DataBind();
    }
}
